<template>
    <div class="addRow" @click="addRow">
        <span class="addIcon">+</span>
        <span class="addWord">增加</span>
    </div>
</template>
<script type="es6">
export default {
    props:{
        data:{
            type: Object,
            default:()=>{
                return{
                    total:0,
                    Data:[]
                }
            },
            
        },
        
    },
    data(){
        return{
            tableData:{}
        }
    },
    computed:{
        doInittableData: {
                get: function () {
                    if (this.$store.getters.common === null) return [];
                    if (this.$store.getters.common.path !== this.$route.path) return;
                    return this.$store.getters.common.tableData;
                },
                set: function (newValue) {
                    if (newValue.path !== this.$route.path) return;
                    return newValue;
                }
            },
    },
    watch:{
        doInittableData: {
                handler(value) {
                    // console.log(value)
                    if (value == undefined) return;
                    this.gettableData(value);
                },
                deep: true
            },
    },
    methods:{
        addRow(){
            console.log(this.data)
        },
        gettableData(value) {
       // console.log(value)
                this.tableData = value;
            },
    },
    created(){
        
    }
}
</script>
<style lang="less" scoped>
.addRow{
    text-align: center;
    cursor: pointer;
    line-height: 40px;
    color:#008af0;
    .addIcon{
        
        font-size: 30px;
        font-weight: bold;   
    }
    .addWord{
        font-size: 20px;

    }
}
</style>

